package com.scst.mapper;

import com.github.pagehelper.Page;
import com.scst.annoation.AutoFill;
import com.scst.dto.EmployeePageQueryDTO;
import com.scst.entity.Employee;
import com.scst.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
    @AutoFill(OperationType.UPDATE)
    void update(Employee employee);
    @Select("select * from employee where id=#{id}")
    Employee getById(Long id);
}
